Separated logic from html