Refactored into functions for testing