abstracted out logic into controllers