refactor sourcecode for livescript syntax