clean up handling of classes and parsing arguments