Deleted unnecessary code/comments and some refactoring