reduce complexity + duplication a bit