Simplify logic to boolean, and cleanup .coffee thanks to @sstephenson.