refactored griditem.js