Refactor for separate teacher and student controllers