Some refactoring to robin.js