add @Override annotations, other cleanups (e.g. remove unnecessary casts)