Updates to factories

Updated the factories to have a cleaner selecting lambda, made agnostic
to application.
Cleaned up some implementation in the model factory