code cleanup, added ability to inject :require dependencies