Factor out input commands