refactors the classpath handling after discussion on Github and analysis of Sebastian pull request #39