Moved some methods to utils class.