small changes: optimizations