added rest of unit tests for utils and cleaned up utils slightly