a bit more repetition cleaned up