Rewrote big part of application for a ~2x performance boost