Some tidy up, refactoring and fixed bug for files not accepting forward slash