New SelfServe lib + some refactoring