move large part of private methods into services namespace