Refactored helpers, additional spec coverage

RFC @jamesbrink, @sobering — Let me know if you have any feedback on these changes