Refactor and add skeleton