Clean loadconfig functions + call loadConfig from main file

Signed-off-by: Philip Luyckx <philip.luyckx@gmail.com>