servo library code refactoring