Move memory cleanup function too
Move all settings to the config.json