Move controller functionalty to table