Refactoring background and sprite drawing