refactoring the drawPlayfield method