Beginnings of refactoring