Refactoring Sprite class