Added some helper functions for DRY compliance.