[WIP] performance optimizations