Cleanup implementation of christmas tree

Use classic functional style. Name intermediate stages.