bug fixes and reorganised plugins