Refactored some code in student and lecturer view, added a basic validation helper