some performance improvements and standardization