Remove tmp file
Refactor & cleanup