Builder refacrtoring

Some improvements were made