Abstract assembly code into helper methods.