[Refactoring] Improving the Ghost code.