Refactoring to accomodate changes outlined in #5