added uniform factories + minor refactoring