refactor sprite impl