use factories where it is possible