Refactored functions (both with underscores here) to make things more DRY