Restructured plugin to allow module separation