Single threaded

Switch to single threaded architecture for better maintainability and comparable performance.