improve code a bit for dependent params