Refactor 3

Refactorization finished