Refactore and clean code