Command rendering logic is moved here.