Refactoring for flexibiltity

Addresses changes for #70.