Source file cleanups

Check for file existance is now an inline function
Improved code readability