Removing dependencies from backtracking method