removes global module dependency and adds test cases