refactor pipeline and added commented out code for next test
enable switch between epoll and nio