refactor; move tests near code; validation; import
fix remaining failing tests