refactor things into general entity queue, add typedefs