Replace some cryptic one liners and other unclear code