Moved Generation Algorithm into separate Class