added new constructor to build from class hints