refactoring : cleanup code, wrap long lines