BGE refactor