Moved funktions from task to library