code optimizations and refactoring
new service