adding modules data and restructuring code