optimizations to storage and db