Refactor local scripts

Signed-off-by: Andres Amado <acactown@gmail.com>