more logic to libs