added a plugin interface + some other little things