refactor the left panel into directive