more style and logic changes