rewrite to get rid of classes