Revert "some optimizations"

This reverts commit 1e3c9da9c8c6f99b47f02b6ec14a527de9172a77.