[mod] refact code