Performence improvements with cloud foundry API
Refactoring, formatting for performance, clarirty, maitainability
Refactoring