simplify button generation, move directory listing to a separate class