added more validations and better profile mapping