Preparing support for XDG_DATA_DIRS
Code cleanup