Refactored code to move status to core module.