Little refactor, done with logic part