Move functions from respository to manager