improve tests and coverage