Refactoring - Ruby Edition (updated from original by Martin Fowler)