Improvements according to @adrianmacneil comments