Refactor and additions