changed module structure and few bug fixing.