fix compile bug
code reorganisation
update default configurations
create the right configuration depending on settings