A dispenser and related methods of dispensing material, in particular viscous materials, from a container and through a nozzle. The dispenser includes a body portion for holding the container in a fixed relationship with the body portion, a plunger movable to advance with respect to the container to urge material from the container through the nozzle, a motor arranged to move the plunger and a controller arranged to control the motor. The motor is controlled according to a distance traveled by the plunger, for example a dispensing distance or a distance the plunger is retracted away from the nozzle, or the motor is controlled according to a speed of the plunger.