Splitting logic by filetype