Cleaned up sample instantiation code