refactors buildings IO file one again, to handle sockets properly