Using array to remove redundant button code in frames