Refacted plugin to work with plugin manager