Final code clean according to Paul's review