Refactor and extra features