utils & refactor