misc efficiency improvements