Move choosing action to render to function

[87b1b6b05b5590e23b3d99067be49b73db9e7366]