modularization

Signed-off-by: Emily Qin <emily.qin@maxwit.com>