restructure commands in functions
implement SD command