Cleaned up client code