refactor utility methods