exactly like .addClass and .removeClass from jquery but with dependencies