added checkServer source
simplified states and introduced multiple sources
code style improvements
transformed sources into proper objects