refactoring to adhere to cob_spec, pass tests