moved resourcelookup to own file
reformatted code