refactored filename creation to helper method