Refactored into services - resulting in errors
Revert "Cleaning up unwanted code"

This reverts commit edabf9c669728def426693d4d18166ac16d6ff29.