refactoring. changed input and output format at module.