renamed plugins into modules and refactor some code