improving.org scala code