Begin refactoring for #10