refactoring on how is organized the setup functions