use constantize instead of eval
use klass method of format_definition