EWS and ILSGateway custom modules refactoring