fix problem with null params, improve coffee code