improved session and config