UPD: extracted some methods from AbstractPlugin and moved them to the api