core: use before/after feature

Change-Id: I3ba635aa28c7c9c5047ea400de111dae2683fda8
Signed-off-by: Alon Bar-Lev <alonbl@redhat.com>