move socket init to boilerplate