make test/ less stupid and refactor