smart function to rake command