refactoring and blitting completed