added connection check
splited configuration into a new file