Rewritten some parts of utils