refact optional require deps setup