Clean up code, switch to factories instead of services.