chess: code cleanup