moved periodic task outside of factory