refactored mountain filter method