Small changes and simplified code