DRY up display creation JS