Implementation of method chaining