Refactored. Moved client code to module.