What about this refactoring http://pastebin.com/F4S4mhkJ ?