improved code style from feedback