dont repeat yourself.
some refactorings and adding js specs around food and canvasSize