1. would be better as a function, so you have:
- a nice explanatory name to it
- if the functionality changes then it is more probable that the name would change
- the code is hidden away if you don't care about the why (maybe you are looking for something else)