Move modal factory to it's own file.