Refactored several methods, deleted unnecessary parts