more logic moved to library