moved plugin to separate file, small fixes-chages