Refactoring
Making more universal method
Bug fixes