refactor the assembler