export more code to classes

Signed-off-by: Liew Zhao Wei <zhaoweiliew@gmail.com>