Some refactoring in the octopos thread plattform