reworked selective factory slightly, better encapsulation now; fixed some tests