move some methods to Util class