converting main coffee file to more functional format