refactored validate and clean methods