Re-factor classes.

Signed-off-by: Toha <tohenk@yahoo.com>