refactor to accomodate commands