relative paths instead of absolute, refactoring a little