Added ability to optionally specify class