started to refactor the whole plugin for LYR-2