More small edits and refactors