Refactory bootstrap custom function