[CHORE] clean up code
[CHORE] handle validation errors