Utilize data_get() and refactor some code to reduce complexity path.

Signed-off-by: crynobone <crynobone@gmail.com>