Long overdue refactoring