generate dependencies in more proper way