Tidying up slate.js