New archi take2

@lalomartins I made few changes to the logic and moved all plugins related logic into a separate module. What do you think?