building function could be built smaller