Refactors grid style with flex box support