Minor refactor. Added redirect to login