More decoupeling, also changed keep alive, but still not perfect :/