Dynamically assign classes.