Fixing Errors / Refactoring