refresh connection daily at 2 a.m. only

refactoring as a bonus