Refactored via to use a command