Huge loopmount performance boost and some cleanup