Remove GetFifoCost, refactor queries