Split complex functions for easier profiling
Check file length