refactor extensions to separate parsing and building better in the code