refactor so it's easy yo compile to js upon deployment