Refactor

started changing structure of the plugin and started coding from scratch in class structure