Re-factory for better code

Just a refactory for handle better the code