Small buttonGenerator() optimalization