simplify build & reorganize code

I believe this is what you said you were planning to do by email. I hope I got it right!