Add tests of factories to unit tests, remove unnecessary lets blocks