Cleanup the code a bit before implement sprite batching