Fixed settings duplicates
Removed duplicated variables and applied some PEP8 enhancements

Signed-off-by: Carlos Oliveira <carlospecter@gmail.com>
Signed-off-by: Alexandre Barbosa <alexandreab@live.com>