Topic/refactoring

Removed an unused file, and refactored sorting functions.