removing builder class and adding logic to server file