removed some logic outside of the draw method