applied Martin Hurton's checkotherwm simplification