cleanup, borrow some code and ideas from nodejs buildpack