Update files module to use data structure for return elements