Quick function refactor