Optimize by reduce number of go subroutines, and cleanup