Beginning to refactor things... again