refactored more and added usage options