refactor Sprite class