Improve runtime and testing