refactoring because of ribs.js