added some utility functions
minor refactor