analyzer refactor WIP