Added ability to use custom classes