Refactor in utils