abstracted functions, use of rake/clean, improved doc