fixed location factory

1. fixed spacing for readability
2. news factory
   - fixed missing var variable 
3. location factory
   - modified params object for location factory (function inputs are unchanged, only affects internal)
   - cleaned up code