Encapsulated code inside methods