Moved logic to config