Some refactoring in the ConnectionFactory. Reduced CPU usage _alot_.