Big refactoring. Added fragments