tighten checks and start throwing exceptions if wrong parameters is passed