Finalized connection refactoring and implemented primitive in-line code
detector