Fixed smaller issues, refactoring