Added spanish support, fixed bugs and refactoring code