Refactors and fixes