refactored stuff into controllers