Refactor, split master to multple files