Per folder sort method + code cleanup