move more logic out into plugin classes