refactor plotfragment