re-organized code, made drawing much mroe composable