re-engineer build process and make more use of Ruby idioms