refs #56: Big refactor