Don't set class at calendar anymore
Move functions to where they are used