Moved some HTML logic