Add a configuration panel and more code cleaning