Polished base/utils and added associated tests.