Revert "Revert "Lets add some optimzation""

This reverts commit 4b2a3c6845013c6e5f58491f1fd8d4f90bea4b66.