Added better parameter handling