More sophisticated file parsing