Refactor serveball directive