Added resources + some refactoring