Added course validations
refactored a line