added standardCallback function to clean up repeat code