Refactored some parameters and made test more flexible.