General cleanup and refactoring
Refactored retrieving values from multiple sources