polished base/utils and added tests