added SHOW_FILE_ACTIVITY conditional for test purposes; a bit of refactoring