Adding support for LFS clean, some code refactors