On the other hand, with this way of proceeding, the module wouldn't be compatible with "shell" SessionTypes, becuase railgun is only available on meterpreter sessions.