Separating code from page