Refactor util