introduce Factory class; remove old Input and require files.