Interim Commit

Beginning of refactoring the code.