refactoring and tests for sensing time extraction