Pushing fixes and refactorin