Improvements based on @ocramz feedback