Refactor class generation method for shapes in tetris main class