Refactoring BouncingPixel's code to be more readable and maintainable