Started some refactoring
More refactoring