move calls to TimeSource.getTimeMillis() inside functions since the
timestamp isn't needed unless the function is actually invoked