Improve layout and loop fonctionality