Fixes performance issues