template + alignment code.