Major refactoring of application in order to use only path variable 'REM' to point to all internal folders