Clearing references
Final improvements