Few minor optimizations, more utility methods.