Refactor cmake structure