Use nil instead of false
Move port and scheme to private methods