fixed and refactors