remove unused factory and add possibility to change transport layer