Partial commit, sharing code

Signed-off-by: Renato Mendes <renato.mendes.1123@gmail.com>