Further refactoring

Signed-off-by: Huu Khiem <TongHuuKhiem@gmail.com>