Converting plugin to instantiable class