Finish layout and core functions