Cleaned up by adding setup function, and now run setup on interval