rearrange file structure
optimize the code with list comprehension