[REFACTOR] performance fixes