Trades cache, refactoring