Added support for modes. Added more arg validations