created new functions for repeated code, updated utility function