change to only one method, and now accepts dynamics id and types

Hi, 

I had to do this, for dynamics ids for charts. And its have so many duplicated code ;)