make rm code more maintainable and add -i flag