Refactored the assembler using the Reader monad