Refactor

Is this ready to go?