Refactored. Refs #58 (in prepration for) #9