REAFACTOR plates.js coding style