Refactor and Add Makefile

Signed-off-by: Akira Hayakawa <ruby.wktk@gmail.com>