removing extra newlines
DRY'd up param access and Resources
DRY'd up scope writing code
DRY'd up method writing