Refactor code for improved readability and maintainability, including function signature updates, new utility functions for score handling, and removal of unused error handling code.