For ENG-4141, fix various bugs causes by misnamed, or mischosen parameters along with some rename and cleanup for clarity