fixed few issues related to performance optimization refactors