line endings fix by phpstorm
refactored ViewFactory to be more generic