Remove obsolete code, add comments
add missing @Nullable annotations
add missing @Nullable annotations, compensate for null