refactory applyclass calendar item