General code review (closes #111)