Make feature into a separate function

Signed-off-by: Jonas Kalderstam <jonas@kalderstam.se>