factored out redundancy