Refactoring, removed unnessecary logic and changed some functions