improved params parsing