Moved some util functions and simplified start-of-age logic.