use func.now() and refactor a bit