minor refactor: a few utility methods