JS: streamline button creation