refactored assembler to separate context