1) refactored code

2) reading sprite component from File