Refactored on c++ conventions