Move command result from templates to javascript