Title: Added last test for editFactory

Description: All green. The last 'it' added for editFactory test. Also made some refactoring.

Commit: Thomas