Refactored chess app according to Kashif's suggestions .