FireJS refactor