refactor the alias logic for a 7% speedup

needs further testing and analysis