Format levels, comments, remove dead code