Moves and renames plugin function; fix #503