Some refactoring to espacio.js and still working on it