Refactoring: creating files in observers