loosen dependencies and add conditional routing