rearrange grunt, implement logic