Refactored Sprite.java