better param validation
cleanup