move param check into seperate method