Drops the courses collection before re-insertion now, some refactoring and added comments