refactored backbone code