refactor source @Author:Alex