Finished global refactorization