Converted to module and removed unnecessary functions/modules