Refactor custom timer API.