refactoring

Still in progress