This makes the function extremely easy to test. Additionally, the default valid duration is now a static constant.