file clean up, refactorings