Structure code a bit more and some more attempts

Still doesn’t work as expected.