refactor Bootstrap#expand and Bootstrap#pattern