Did some much-needed optimization