Modularizing main file

Signed-off-by: Lucas Kanashiro <lucas-kanashiro@hotmail.com>
Signed-off-by: Alexandre Barbosa <alexandreab@live.com>