Separate logic from presentation (close #1)