Refactored object instanciation
Updates code to the new syntax