applied Factory Pattern in board