Re-organized utility methods and added some unit tests