Renamed module to make it testable and added tests