Final code global refactor