Fix error when handling object as method arguments, minor refactoring