Fix attributes issue. Move two function from config to main module