Moved some methods to utils