Adding util method, adding tests