core: use before/after feature

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