added some tests for utils and simplified a bit